<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "goods_item".
 *
 * @property string $id
 * @property string $name
 * @property string $price
 * @property integer $gross
 * @property integer $residue
 * @property integer $sales
 * @property string $attribute_unique
 * @property string $attribute_values
 * @property integer $is_default
 * @property string $enabled
 * @property string $goods_id
 * @property string $app_id
 * @property integer $create_time
 */
class GoodsItem extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'goods_item';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['price'], 'number'],
            [['gross', 'residue', 'sales', 'is_default', 'create_time'], 'integer'],
            [['id', 'goods_id'], 'string', 'max' => 36],
            [['name', 'attribute_values'], 'string', 'max' => 300],
            [['attribute_unique'], 'string', 'max' => 100],
            [['enabled'], 'string', 'max' => 10],
            [['app_id'], 'string', 'max' => 30],
            [['attribute_unique'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'price' => 'Price',
            'gross' => 'Gross',
            'residue' => 'Residue',
            'sales' => 'Sales',
            'attribute_unique' => 'Attribute Unique',
            'attribute_values' => 'Attribute Values',
            'is_default' => 'Is Default',
            'enabled' => 'Enabled',
            'goods_id' => 'Goods ID',
            'app_id' => 'App ID',
            'create_time' => 'Create Time',
        ];
    }
}
